﻿<UserControl x:Class="Mengsk.ProxyDelivery.GoodsSpider.UI.GoodsSpiderUC"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="800" d:DesignWidth="1000" Loaded="UserControl_Loaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions >
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Margin="3" VerticalAlignment="Center" Text="抓取工具类型："  />
            <ComboBox Grid.Column="1" Margin="3" VerticalAlignment="Center" Name="cbbSpiders" Width="80" DisplayMemberPath="Name" />
            <TextBlock Grid.Column="2" Margin="3" VerticalAlignment="Center" Text="抓取网址：" />
            <TextBox Grid.Column="3" Margin="3" VerticalAlignment="Center" Name="tbURL" Text="{Binding Path=SelectedItem.URL, ElementName=cbbSpiders}" />
            <Button Grid.Column="5" Margin="3" VerticalAlignment="Center" Width="80" Content="抓取商家" Name="btnSpiderVendor" Click="btnSpiderVendor_Click"/>
            <Button Grid.Column="6" Margin="3" VerticalAlignment="Center" Width="80" Content="抓取商品" Name="btnSpiderGoods" Click="btnSpiderGoods_Click"/>
            <Button Grid.Column="7" Margin="3" VerticalAlignment="Center" Width="80" Content="停止抓取" Name="btnStopSpider" Click="btnStopSpider_Click"/>
        </Grid>

        <Grid Grid.Row="2" Name="dgSpiders"/>

        <StackPanel Grid.Row="1" Orientation="Horizontal" >

            <TextBlock Text="线程数量:" Margin="3" VerticalAlignment="Center" FontSize="14"/>
            <ComboBox Name="cbbThreadCount" Margin="3" VerticalAlignment="Center" FontSize="14" Width="60" SelectionChanged="cbbThreadCount_SelectionChanged">
                <ComboBoxItem>1</ComboBoxItem>
                <ComboBoxItem>4</ComboBoxItem>
                <ComboBoxItem>9</ComboBoxItem>
                <ComboBoxItem>16</ComboBoxItem>
                <ComboBox.SelectedIndex>2</ComboBox.SelectedIndex>
            </ComboBox>
            <TextBlock Text="要抓取的厂家名称：" Margin="3" VerticalAlignment="Center" FontSize="14"/>
            <TextBox Name="tbManualVendor" Width="150" Margin="3" VerticalAlignment="Center"/>
            <Button Name="btnManual" Content="手动抓取" Margin="3" VerticalAlignment="Center" Width="80" Click="btnManual_Click"/>
        </StackPanel>
    </Grid>
</UserControl>
